<?php

// +----------------------------------------------------------------------
// |用户model
// +----------------------------------------------------------------------
namespace app\common\Model;

use think\Model;

class UserModel extends Model{

    // 表名
    protected $name = 'users';
    // 表主键
    protected $pk = 'id';


     // 获取所有有效用户数据
     public function getActiveStatus()
     {
         $data=$this->where('status', 1)->field('id,nickname')->select()->toArray();
         return array_column($data,null,'id');
     }
     
     // 获取所有有效用户数据
     public function getActivelist()
     {
         $data=$this->field('id,nickname')->select()->toArray();
         return array_column($data,null,'id');
     }
}


